#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{
    int fd = open("filename", O_WRONLY);
    char *mag = "ni hao a\n";
    write(fd, mag, strlen(mag));
    close(fd);
    return 0;
}
